package com.woniuxy.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

//生成订单编号
public class OrderUtil {

	public static String generateOrderNo() {
		String no = "PM";
		Date now = new Date();
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String num = String.valueOf(new Random().nextInt(10000));

		for (int i = 0; i < 4 - num.length(); i++) {
			num = "0" + num;
		}
		return no + dateFormat.format(now) + num;
	}
}
